home *** CD-ROM | disk | FTP | other *** search
- Path: news.uh.edu!usenet
- From: Sensarn <txs53132@bayou.uh.edu>
- Newsgroups: comp.lang.c++
- Subject: Re: Inline Assembler and OOP
- Date: 17 Mar 1996 18:19:06 GMT
- Organization: AEtna Insurance Agency
- Message-ID: <4ihl2q$5gh@masala.cc.uh.edu>
- References: <4iaqcn$mfu@masala.cc.uh.edu> <314B4A90.64BE@symantec.com>
- NNTP-Posting-Host: sip-14263.public-dialups.uh.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1 (Windows; U; 16bit)
-
- Walter Bright <wbright@symantec.com> wrote:
- >Sensarn wrote:
- >< struct double_buffer {
- >< unsigned char *buffer; /* Actual data */
- >< unsigned int buffer_size; /* Actual size of buffer */
- >< double_buffer(int num_lines=200); /* Constructor */
- >< };
- >< double_buffer::double_buffer(int num_lines) {
- >< asm {
- >< les di,buffer /* Expression syntax error here */
- >< mov cx,buffer_size/2 /* Here too */
- >< }
- >< }
- >< Is there some reason why I cannot access buffer and buffer_size in the
- >< asm statement (even though the asm statement is inside a member
- >< function).
- >
- >The trouble is that 'buffer' can only be accessed through the 'this' pointer.
- >Your asm code needs to be rewritten as:
- > les di,this
- > mov cx,es:buffer_size[di]
- > shr cx,1
- > les di,es:buffer[di]
-
- Thanks!
-
- --
- ______________________________
-
- Steven Sensarn
- E-Mail - txs53132@bayou.uh.edu
- ______________________________
-
-
-